/*    */ package change.org.eclipse.swt.browser;
/*    */ 
/*    */ import org.eclipse.swt.widgets.FileDialog;
/*    */ import org.eclipse.swt.widgets.Shell;
/*    */ import org.mozilla.interfaces.nsIHelperAppLauncher;
/*    */ import org.mozilla.interfaces.nsIHelperAppLauncherDialog;
/*    */ import org.mozilla.interfaces.nsILocalFile;
/*    */ import org.mozilla.interfaces.nsISupports;
/*    */ import org.mozilla.xpcom.Mozilla;
/*    */ 
/*    */ class MozillaHelperAppLauncherDialog
/*    */   implements nsIHelperAppLauncherDialog
/*    */ {
/*    */   public nsISupports queryInterface(String aIID)
/*    */   {
/* 24 */     return Mozilla.queryInterface(this, aIID);
/*    */   }
/*    */ 
/*    */   public void show(nsIHelperAppLauncher aLauncher, nsISupports aContext, long aForced)
/*    */   {
/* 30 */     aLauncher.saveToDisk(null, false);
/*    */   }
/*    */ 
/*    */   public nsILocalFile promptForSaveToFile(nsIHelperAppLauncher aLauncher, nsISupports aWindowContext, String aDefaultFile, String aSuggestedFileExtension) {
/* 34 */     Shell shell = new Shell();
/* 35 */     FileDialog fileDialog = new FileDialog(shell, 8192);
/* 36 */     fileDialog.setFileName(aDefaultFile);
/* 37 */     fileDialog.setFilterExtensions(new String[] { aSuggestedFileExtension });
/* 38 */     String name = fileDialog.open();
/* 39 */     shell.close();
/*    */ 
/* 41 */     if (name == null) {
/* 42 */       if (aLauncher != null)
/*    */       {
/* 44 */         aLauncher.cancel(-2142568446L);
/* 45 */         return null;
/*    */       }
/* 47 */       throw new RuntimeException("helperAppLauncher is null.");
/*    */     }
/* 49 */     return Mozilla.getInstance().newLocalFile(name, true);
/*    */   }
/*    */ 
/*    */   public nsILocalFile promptForSaveToFile(nsIHelperAppLauncher arg0, nsISupports arg1, String arg2, String arg3, boolean arg4)
/*    */   {
/* 54 */     return null;
/*    */   }
/*    */ }
